home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Tool Chest / Dev.CD Aug 98 TC.toast / Sample Code / Interapplication Communication / MenuScripter 4.0 / Sources / MSAERecording.h < prev    next >
Encoding:
Text File  |  1996-07-09  |  2.9 KB  |  96 lines  |  [TEXT/CWIE]

  1. // MSAERecording.h
  2. //
  3. // Original version by Jon Lansdell and Nigel Humphreys.
  4. // 4.0 and 3.1 updates by Greg Sutton.
  5. // ©Apple Computer Inc 1996, all rights reserved.
  6.  
  7. #ifndef __MSAERECORDING__
  8. #define __MSAERECORDING__
  9.  
  10. #include "MSGlobals.h"
  11.  
  12. #include "MSToken.h"
  13.  
  14. OSErr            InstallRecordingHandlers(void);
  15.  
  16. pascal OSErr     HandleStartRecording(const AppleEvent    *theAppleEvent,
  17.                                             AppleEvent    *reply,
  18.                                             long        handlerRefCon);    
  19.  
  20. pascal OSErr     HandleStopRecording(const AppleEvent    *theAppleEvent,
  21.                                             AppleEvent    *reply,
  22.                                             long        handlerRefCon);    
  23.  
  24. OSErr        MakeWindowObj(WindowPtr theWindow, AEDesc *result);
  25. OSErr        MakeDocumentObj(WindowPtr theWindow, AEDesc *result);
  26.  
  27. OSErr        MakeTextObjFromToken(TextToken* theToken, AEDesc* result);
  28. OSErr        MakeSelectedTextObj(WindowPtr    theWindow,
  29.                                 TEHandle    theTextEditHandle,
  30.                                 AEDesc        *result);
  31. OSErr        MakeTextObj(WindowPtr theWindow, short selStart, short selEnd, AEDesc *result);
  32.  
  33.  
  34. enum editCommandType
  35. {
  36.     editCutCommand   = 1,
  37.     editCopyCommand  = 2,
  38.     editPasteCommand = 3,
  39.     editClearCommand = 4
  40. };
  41.  
  42. typedef enum editCommandType editCommandType;
  43.  
  44. OSErr    SendSelectionEvent(DPtr docPtr);
  45. void    DoEditCommand(DPtr theDocument, editCommandType whatCommand);
  46. OSErr    SendAESetObjProp(AEDesc *theObj, DescType theProp, AEDesc *theData, AEAddressDesc *toWhom);
  47.  
  48.     // Text Commands
  49.     
  50. void    IssueCutCommand(DPtr theDocument);
  51. void    IssueCopyCommand(DPtr theDocument);
  52. void    IssuePasteCommand(DPtr theDocument);
  53. void    IssueClearCommand(DPtr theDocument);
  54. void    IssueFontCommand(DPtr theDocument, short theItem);
  55. void    IssueSizeCommand(DPtr theDocument, short theItem);
  56. void    IssueStyleCommand(DPtr theDocument, short theItem);
  57.  
  58.     // Window Commands
  59.  
  60. void    IssueZoomCommand(WindowPtr whichWindow, short whichPart);
  61. void    IssueCloseCommand(WindowPtr whichWindow);
  62. void    IssueSizeWindow(WindowPtr whichWindow, short newHSize,short newVSize);
  63. void    IssueMoveWindow(WindowPtr whichWindow, Rect* sizeRect);
  64. void    IssuePageSetupWindow(WindowPtr whichWindow, TPrint thePageSetup);
  65. void    IssueGXPageSetupWindow(WindowPtr whichWindow, gxJob thGXJob);
  66.  
  67. #define kUsePrintDialog true
  68. #define kNoPrintDialog false
  69. void    IssuePrintWindow( WindowPtr whichWindow, Boolean useDialog);
  70.  
  71.     // Document Commands
  72.  
  73. OSErr    IssueAEOpenDoc(FSSpec myFSSpec);
  74. void    IssueAENewWindow(void);
  75. OSErr    IssueSaveCommand(WindowPtr theWindow, FSSpecPtr where);
  76.                                                 
  77. OSErr    IssueRevertCommand(WindowPtr theWindow);
  78. OSErr    IssueQuitCommand(void);
  79.  
  80.     // Recording of Keystrokes
  81.  
  82. void    AddKeyToTypingBuffer(DPtr theDocument, char theKey);
  83. void    FlushAndRecordTypingBuffer(void);
  84.  
  85.  
  86. void    StyleTokConst(short theStyleItem, DescType *thekConst);
  87. OSErr    BuildTypeTextStylesDesc(Style onStyles, Style offStyles, AEDesc *resultDesc);
  88. OSErr    BuildTextStylesDesc(Style theStyle, AEDesc *resultDesc);
  89. OSErr    BuildStyledTextDesc(TEHandle theHTE, short start, short howLong, AEDesc *resultDesc);
  90.  
  91.  
  92. Boolean    PoseSizeDialog(long *whatSize);
  93. OSErr    IssueSetDataObjToBufferContents(const AEDesc* theObj);
  94.  
  95. #endif
  96.